#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QDialog>
#include "usersession.h"

namespace Ui {
class LoginWidget;
}

class LoginWidget : public QDialog
{
    Q_OBJECT

signals:
    void loginAttempt(const QString& username, const QString& password);

public:
    explicit LoginWidget(UserSession *session, QWidget *parent = nullptr);
    ~LoginWidget();

private slots:
    void onLoginClicked();
    void onSessionAboutToTimeout();

private:
    Ui::LoginWidget *ui;
    UserSession *m_session;

    bool validateInput();
};

#endif // LOGINWIDGET_H